π‘οΈ Sentinel: Fix information leakage in error responses#151
π‘οΈ Sentinel: Fix information leakage in error responses#151AGI-Corporation wants to merge 1 commit intomainfrom
Conversation
- Implemented a global exception handler in `backend/main.py` to catch unhandled errors and return a generic "Internal server error" message. - Configured central logging to ensure all unhandled exceptions are logged with stack traces server-side. - Refactored `agents/mistral_agent/agent.py` to stop leaking internal exception strings in HTTP 500 responses. - Added `tests/test_sentinel_errors.py` to verify error leakage prevention and ensure built-in FastAPI exceptions (404, 422) are still informative. - Ensured PEP8 compliance and verified all tests pass. Co-authored-by: AGI-Corporation <186229839+AGI-Corporation@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 53 minutes and 23 seconds. β How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. π¦ How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. βΉοΈ Review infoβοΈ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: π Files selected for processing (3)
β¨ Finishing Touchesπ§ͺ Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
π‘οΈ Sentinel: Fix information leakage in error responses
π¨ Severity: MEDIUM
π‘ Vulnerability: Unhandled exceptions and explicit HTTP 500 errors were returning raw exception strings (including potential stack traces or sensitive internal details) to the client. This could assist an attacker in mapping the application's internal structure and identifying further vulnerabilities.
π― Impact: Exposure of internal system details, library versions, and potential database structure through error messages.
π§ Fix:
@app.exception_handler(Exception)inbackend/main.pythat sanitizes unexpected errors.agents/mistral_agent/agent.pyto log errors server-side and return generic safe messages.β Verification:
tests/test_sentinel_errors.pyspecifically checks that raw error messages are suppressed while maintaining 404 and 422 informativeness.{"detail": "Internal server error"}.PR created automatically by Jules for task 7671149980504850261 started by @AGI-Corporation